<template>
  <view class="box">
    <view class="body">
    <view
      class="container"
      v-for="(item, index) in list"
      :key="item.id"
      @click="fn(index)"
    >
      <view class="title">{{ item.title }}</view>
      <view class="inner">{{ item.question }}</view>
      <view class="footer">
        <view class="footer_left">
          <view>{{ "匿名" }}</view>
          <view>{{ item.time }}</view>
        </view>
        <view class="footer_right">评论({{ item.comment }})</view>
      </view>
    </view>
  </view>
  </view>
</template>
<script>
import data from "./index.json";
export default {
  props: ["list"],
  data() {
    return {};
  },
  methods: {
    fn(index) {
      uni.navigateTo({
        url: `./detail?index=${index}`,
      });
    },
  },
};
</script>
<style lang="scss" scoped>
.box{
  width: 100%;
  height: 100%;
  background: #E5E5E5;
}
.body {
  width: 90%;
  height: 100%;
  margin-left: 5%;
  .container {
    width: 100%;
    height: 100%;
    border-radius: 10upx;
    margin: 20upx 0 20upx -10upx;
    padding: 10upx;
    box-shadow: 3upx 3upx 3upx 3upx rgba(0,0,0,.2);
    background: #FFF;
    .title {
      width: 96%;
      height: 80upx;
      display: flex;
      align-items: center;
      justify-content: left;
      color: #000;
      margin-left: 2%;
      font-size: 12px;
      font-weight: bolder;
    }
    .inner {
      width: 96%;
      height: 120upx;
      margin-left: 2%;
      display: flex;
      align-items: top;
      justify-content: left;
      color: rgb(79, 77, 87);
    }
    .footer {
      width: 96%;
      display: flex;
      justify-content: space-between;
      align-items: center;
      color: #cccccc;
      margin-left: 2%;
      .footer_left {
        width: 60%;
        display: flex;
        view {
          width: 50%;
          justify-content: left;
        }
      }
      .footer_right {
        width: 30%;
        text-align: right;
      }
    }
  }
}
</style>